let uid = location.href.split('?')[1].split('=')[1]
console.log(uid);
let copyrightname = document.querySelector('.copyrightname'),
    description = document.querySelector('.description')

const get_one_copyright = async() => {
    let response = await ajax(`get_one_copyright?id=${uid}`)
    let copyright = response.data[0]
    copyrightname.value = copyright.copyright_name
    description.value = copyright.description
}

const update_copyright = () => {
    let copyright_name1 = copyrightname.value,
        description1 = description.value
    let obj = {
        id: uid,
        copyright_name: copyright_name1,
        description: description1
    }
    const response = ajax('updatecopyright', 'PUT', obj)
    alert('修改成功!')
    location.href = './copyright.html'
}
window.onload = function() {
    get_one_copyright()
}